Introduction

This is a brief workflow highlighting the exploratory analysis of survey data mined to assist in the writing of the manuscript, “Gender Disparities Persist in Endoscopy Suite” (Rabinowitz, et al.). Where appropriate, samples of the exact R syntax used will be displayed, along with the corresponding output (tabular data, graphical plots, maps, etc.).




DATA CLEAN-UP


require(broom)
require(dplyr)

SURVEY  <-
    GENDER_DIFF_DATA_LABELS %>% 
    filter( COMPLETE != "Incomplete" &
            BIRTHSEX != "OTHER" &
            !is.na(BIRTHSEX) ) %>% 
   select( BIRTHSEX, RACE_SOUTHASIAN:RACE_OTHER, AGE, TRAINING_LEVEL, HEIGHT, GLOVE, GLOVE_SIZE_AVAILABLE, PERFORMANCE_HOURS, TEACHER_GENDER_PREFERENCE,
           FEMALE_TRAINERS, MALE_TRAINERS, EVER_INJURED, EXPERIENCED_TRANSIENT_PAIN_NO, EXPERIENCED_TRANSIENT_PAIN_HAND, EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER,
           EXPERIENCED_TRANSIENT_PAIN_BACK, EXPERIENCED_TRANSIENT_PAIN_LEG, EXPERIENCED_TRANSIENT_PAIN_FOOT, GROWING_PAINS,
           FELLOWSHIP_FORMAL_ERGO_TRAINING, INFORMAL_TRAINING, TRAINING_TECHNIQUES_POSTURAL, TRAINING_TECHNIQUES_BEDHEIGHT, TRAINING_TECHNIQUES_BEDANGLE,
           TRAINING_TECHNIQUES_MONITORHEIGHT, TRAINING_TECHNIQUES_MUSCULOSKELETAL, TRAINING_TECHNIQUES_EXERCISE_STRETCHING, TRAINING_TECHNIQUES_DIAL_EXTENDERS,
           TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE, ERGO_TRAINING_BUDGET, ERGO_FEEDBACK, ERGO_FEEDBACK_BY_WHOM, ERGO_OPTIMIZATION, GLOVE_SIZE_AVAILABLE,
           DIAL_EXTENDERS_AVAILABLE, DIAL_EXTENDERS_ENCOURAGED, DIAL_EXTENDERS_FEMALEATT, DIAL_EXTENDERS_MALEATT, PEDI_COLONOSCOPES_AVAILABLE,
           LEAD_APRONS_DONTKNOW,  LEAD_APRONS_LW_ONEPIECE, LEAD_APRONS_LW_TWOPIECE, LEAD_APRONS_STANDARD_ONEPIECE, LEAD_APRONS_STANDARD_TWOPIECE,
           LEAD_APRONS_DOUBLE, LEAD_APRONS_THYROID, LEAD_APRONS_MATERNALDOS, LEAD_APRONS_FETALDOS,
           ERGO_FORMAL_TIMEOUT_PRIOR, ERGO_INFORMAL_TIMEOUT_PRIOR, MONITORS_ADJUSTABLE, TEACHER_SENSITIVITY_STATURE_HANDSIZE,
           TEACHER_SENSITIVITY_BY_GENDER, TACTILE_INSTRUCTION_FROM_MALES, TACTILE_INSTRUCTION_FROM_FEMALES,
           COMFORTABLE_ASKING_NURSES, ASK_NURSES_ONCE, ASK_NURSES_TWICE, ASK_NURSES_MORE,
           COMFORTABLE_ASKING_TECHS, MALE_ATTENDINGS_ASKING, FEMALE_ATTENDINGS_ASKING,
           RECOGNIZED_RESPECTED_ES_STAFF, RECOGNIZED_RESPECTED_ANESTHETISTS, RECOGNIZED_RESPECTED_GASTRO_ATTENDING, FIRST_NAME_NO_PERMISSION, 
           ERGO_TRAINING_MANDATORY, ERGO_OPTIMIZAITON_BUDGET_REQUIRED, EXPERIENCE_IMPROVED_DIAL_EXTENDERS, EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES, EXPERIENCE_IMPROVED_APRONS,
           ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED,
           ERGONOMIC_IMPORTANCE, MITIGATING_MUSCLE_STRAIN, BED_POSITION, ENDO_TRAINER_POSITION, WHEN_DISABILITY_INSURANCE) %>% 
  
    mutate(AGE2 = ifelse( AGE %in% c('< 30', '30-34', '35-40'), AGE, '> 40' )) %>% 
  
  
    mutate( RACE = ifelse( RACE_HISPANIC == "Y", "HISPANIC",
                   ifelse( RACE_WHITE == "Y", "WHITE",
                   ifelse( RACE_BLACK == "Y", "BLACK",
                   ifelse (RACE_SOUTHASIAN == "Y", "ASIAN SOUTH",
                   ifelse (RACE_EASTASIAN == "Y", "ASIAN EAST",
                   ifelse (RACE_NATIVEAMER == "Y", "OTHER",
                   ifelse (RACE_PACIFICISLAND == "Y", "OTHER",
                   ifelse (RACE_OTHER == "Y", "OTHER", "OTHER" )))))))),
            RACE = factor(RACE, levels= c('ASIAN EAST', 'ASIAN SOUTH', 'BLACK', 'HISPANIC', 'WHITE', 'OTHER'))) %>%
  
    mutate( BIRTHSEX = factor( BIRTHSEX,  levels= c("F","M") ))  %>% 
    mutate (AGE2 = factor(AGE2, levels = c('< 30', '30-34', '35-40', '> 40'))) %>%  

    mutate (RACE2 = case_when( RACE != "WHITE" ~ 'NON-WHITE',
                               TRUE ~ 'WHITE'),
            RACE2 = factor(RACE2, levels = c("WHITE", "NON-WHITE"))) %>% 
            

                           
                           
    mutate( TRAINING_LEVEL = factor (TRAINING_LEVEL, levels= c('First year fellow','Second year fellow', 'Third year fellow', 'Advanced fellow'))) %>% 
    mutate( TRAINING_LEVEL = recode_factor( TRAINING_LEVEL, 'First year fellow'= 'First Year', 
                                                            'Second year fellow'= 'Second Year', 
                                                            'Third year fellow' = 'Third Year', 
                                                            'Advanced fellow' = "Avanced", .ordered = T) ) %>% 
   mutate( HEIGHT2 = factor(HEIGHT, levels= c("< 5'", "5-5'3", "5'4-5'6", "5'7-5'9", "5'10-6'", "6'1-6'4", "> 6'4"))) %>% 
   mutate( PERFORMANCE_HOURS = factor(PERFORMANCE_HOURS),
           PERFORMANCE_HOURS = recode_factor(PERFORMANCE_HOURS, "< 10" = "< 10",
                                                               "10-20" = "10-20",
                                                               "21-30" = "21-30",
                                                               "31-40" = "31-40",
                                                               .default = "> 40")) %>% 
  
  mutate(TEACHER_GENDER_PREFERENCE = factor(TEACHER_GENDER_PREFERENCE),
         TEACHER_GENDER_PREFERENCE = recode_factor(TEACHER_GENDER_PREFERENCE, "Yes" = "Yes",
                                                                      .default = "No")) %>% 
  
  mutate( FEMALE_TRAINERS = factor(FEMALE_TRAINERS),
          FEMALE_TRAINERS = recode_factor(FEMALE_TRAINERS, 'None' = 'None',
                                                           '1-2' = '1-2',
                                                           '3-5' = '3-5',
                                                           '6-10' = '6-10',
                                                           '> 10' = '> 10' )) %>% 
  mutate( MALE_TRAINERS = factor(MALE_TRAINERS),
          MALE_TRAINERS = recode_factor(MALE_TRAINERS, 'None' = 'None',
                                                           '1-2' = '1-2',
                                                           '3-5' = '3-5',
                                                           '6-10' = '6-10',
                                                           '> 10' = '> 10' )) %>% 
  
  mutate( EVER_INJURED = factor(EVER_INJURED)) %>% 
  mutate( EXPERIENCED_TRANSIENT_PAIN_NO = factor(EXPERIENCED_TRANSIENT_PAIN_NO)) %>% 
  mutate( EXPERIENCED_TRANSIENT_PAIN_HAND = factor(EXPERIENCED_TRANSIENT_PAIN_HAND)) %>% 
  mutate( EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER = factor(EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER)) %>% 
  mutate( EXPERIENCED_TRANSIENT_PAIN_BACK = factor(EXPERIENCED_TRANSIENT_PAIN_BACK)) %>% 
  mutate( EXPERIENCED_TRANSIENT_PAIN_LEG = factor(EXPERIENCED_TRANSIENT_PAIN_LEG)) %>% 
  mutate( EXPERIENCED_TRANSIENT_PAIN_FOOT = factor(EXPERIENCED_TRANSIENT_PAIN_FOOT))  %>% 
  
  mutate( GROWING_PAINS = factor(GROWING_PAINS)) %>% 
  mutate( FELLOWSHIP_FORMAL_ERGO_TRAINING = factor(FELLOWSHIP_FORMAL_ERGO_TRAINING)) %>% 
  mutate( INFORMAL_TRAINING = factor(INFORMAL_TRAINING)) %>% 
  mutate( TRAINING_TECHNIQUES_POSTURAL = factor(TRAINING_TECHNIQUES_POSTURAL)) %>% 
  mutate( TRAINING_TECHNIQUES_BEDHEIGHT = factor(TRAINING_TECHNIQUES_BEDHEIGHT)) %>% 
  mutate( TRAINING_TECHNIQUES_BEDANGLE = factor(TRAINING_TECHNIQUES_BEDANGLE)) %>% 
  mutate( TRAINING_TECHNIQUES_MONITORHEIGHT = factor(TRAINING_TECHNIQUES_MONITORHEIGHT)) %>% 
  mutate( TRAINING_TECHNIQUES_MUSCULOSKELETAL = factor(TRAINING_TECHNIQUES_MUSCULOSKELETAL)) %>% 
  mutate( TRAINING_TECHNIQUES_EXERCISE_STRETCHING = factor(TRAINING_TECHNIQUES_EXERCISE_STRETCHING)) %>% 
  mutate( TRAINING_TECHNIQUES_DIAL_EXTENDERS = factor(TRAINING_TECHNIQUES_DIAL_EXTENDERS)) %>% 
  mutate( TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE = factor(TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE)) %>% 
  
  mutate( ERGO_TRAINING_BUDGET = factor(ERGO_TRAINING_BUDGET),
          ERGO_TRAINING_BUDGET = recode_factor(ERGO_TRAINING_BUDGET, 'Yes' = 'Y',
                                                                     'No' = 'N',
                                                                     "Don't know" = 'DK', .ordered= T)) %>% 
  

  mutate( ERGO_FEEDBACK = factor(ERGO_FEEDBACK),
          ERGO_FEEDBACK = recode_factor(ERGO_FEEDBACK, 'Never' = 'Never',
                                                       'Rarely' = 'Rarely',
                                                       'Sometimes' = 'Sometimes',
                                                        'Often' = 'Often', .ordered = T )) %>% 
            
  mutate( ERGO_FEEDBACK_BY_WHOM = factor(ERGO_FEEDBACK_BY_WHOM),
          ERGO_FEEDBACK_BY_WHOM = recode_factor(ERGO_FEEDBACK_BY_WHOM, 'I do not or rarely receive ergonomic feedback' = "Do not/rarely received feedback",
                                                                     'Mostly male endoscopy teachers' = 'Mostly male teachers',
                                                                     'Mostly female endoscopy teachers' = 'Mostly female teachers',
                                                                     'Both male and female endoscopy teachers equally' = 'Both equally' , .ordered = T)) %>% 
  
  
  mutate( ERGO_OPTIMIZATION = factor(ERGO_OPTIMIZATION),
          ERGO_OPTIMIZATION = recode_factor(ERGO_OPTIMIZATION, 'Y' = 'Y',
                                                                     'N' = 'N',
                                                                     "Don't know" = 'DK', .ordered= T)) %>% 
  
  mutate( GLOVE_SIZE_AVAILABLE = factor(GLOVE_SIZE_AVAILABLE)) %>% 
  
  mutate( DIAL_EXTENDERS_AVAILABLE = factor(DIAL_EXTENDERS_AVAILABLE),
          DIAL_EXTENDERS_AVAILABLE = recode_factor(DIAL_EXTENDERS_AVAILABLE, 'Y' = 'Y',
                                                                             'N' = 'N',
                                                                             "Don't know" = 'DK', .ordered= T)) %>% 
  
  mutate( DIAL_EXTENDERS_ENCOURAGED = factor(DIAL_EXTENDERS_ENCOURAGED),
          DIAL_EXTENDERS_ENCOURAGED = recode_factor(DIAL_EXTENDERS_ENCOURAGED, 'Y' = 'Y',
                                                                                 'N' = 'N',
                                                                                 "Don't use" = 'DU', .ordered= T)) %>% 
  
  

  mutate( DIAL_EXTENDERS_FEMALEATT = factor(DIAL_EXTENDERS_FEMALEATT),
          DIAL_EXTENDERS_FEMALEATT = recode_factor(DIAL_EXTENDERS_FEMALEATT, 'Not Likely' = 'Not Likely',
                                                                             'Somewhat Likely' = 'Somewhat Likely',
                                                                             'Sometimes' = 'Sometimes',
                                                                             'Verly Likely' = 'Very Likely',
                                                                             'NA' = 'NA', .ordered = T )) %>% 

  mutate( DIAL_EXTENDERS_MALEATT = factor(DIAL_EXTENDERS_MALEATT),
          DIAL_EXTENDERS_MALEATT = recode_factor(DIAL_EXTENDERS_MALEATT, 'Not Likely' = 'Not Likely',
                                                                             'Somewhat Likely' = 'Somewhat Likely',
                                                                             'Sometimes' = 'Sometimes',
                                                                             'Verly Likely' = 'Very Likely',
                                                                             'NA' = 'NA', .ordered = T ))  %>% 
    mutate( PEDI_COLONOSCOPES_AVAILABLE = factor(PEDI_COLONOSCOPES_AVAILABLE),
          PEDI_COLONOSCOPES_AVAILABLE = recode_factor(PEDI_COLONOSCOPES_AVAILABLE, 'Y' = 'Y',
                                                                                   'N' = 'N',
                                                                                   "Don't know" = 'DK', .ordered= T)) %>% 
  
   mutate( LEAD_APRONS_DONTKNOW = factor(LEAD_APRONS_DONTKNOW),
          LEAD_APRONS_DONTKNOW = recode_factor(LEAD_APRONS_DONTKNOW, 'N' = 'Aware',
                                                                     'Y' = 'Not Aware',.ordered= T)) %>% 
  
   mutate( TEACHER_SENSITIVITY_BY_GENDER = factor(TEACHER_SENSITIVITY_BY_GENDER),
          TEACHER_SENSITIVITY_BY_GENDER = recode_factor(TEACHER_SENSITIVITY_BY_GENDER, 'Male' = 'Male',
                                                           'Female' = 'Female',
                                                           'Both equally' = 'Both Equally',
                                                           'I have not had female endoscopy teachers' = 'Never had female teacher',
                                                           'Not sure' = 'Not Sure', .ordered= T ))  %>% 
  
   mutate( TACTILE_INSTRUCTION_FROM_MALES = factor(TACTILE_INSTRUCTION_FROM_MALES),
          TACTILE_INSTRUCTION_FROM_MALES = recode_factor(TACTILE_INSTRUCTION_FROM_MALES, 'No' = 'No',
                                                                                         'Yes, rarely' = 'Rarely',
                                                                                         'Yes, often' = 'Often', .ordered= T)) %>% 
  
   mutate( TACTILE_INSTRUCTION_FROM_FEMALES = factor(TACTILE_INSTRUCTION_FROM_FEMALES),
          TACTILE_INSTRUCTION_FROM_FEMALES = recode_factor(TACTILE_INSTRUCTION_FROM_FEMALES, 'No' = 'No',
                                                                                         'Yes, rarely' = 'Rarely',
                                                                                         'Yes, often' = 'Often', .ordered= T)) %>% 
  
   mutate( NURSES_ASKING = ifelse( ASK_NURSES_MORE == "Y", "More than Twice",
                           ifelse( ASK_NURSES_TWICE == "Y", "Twice",
                           ifelse( ASK_NURSES_ONCE == "Y", "Once", NA))),
           
           NURSES_ASKING = factor(NURSES_ASKING),
           NURSES_ASKING = recode_factor(NURSES_ASKING, "Once" = "Once",
                                                        "Twice" = "Twice",
                                                        "More than Twicce" = "More than Twice", .ordered=T),
  
           MALE_ATTENDINGS_ASKING = factor(MALE_ATTENDINGS_ASKING),
           MALE_ATTENDINGS_ASKING = recode_factor(MALE_ATTENDINGS_ASKING, "Once" = "Once",
                                                                          "Twice" = "Twice",
                                                                           "More than Twice" = "More than Twice", .ordered=T),

           FEMALE_ATTENDINGS_ASKING = factor(FEMALE_ATTENDINGS_ASKING),
           FEMALE_ATTENDINGS_ASKING = recode_factor(FEMALE_ATTENDINGS_ASKING, "Once" = "Once",
                                                                             "Twice" = "Twice",
                                                                             "More than twice" = "More than Twice",
                                                                             "Not applicable, I do not work with any female attendings" = "Don't work with FemAtt", .ordered=T)) %>% 
  
   mutate( ERGO_TRAINING_MANDATORY = factor(ERGO_TRAINING_MANDATORY),
           ERGO_TRAINING_MANDATORY = recode_factor(ERGO_TRAINING_MANDATORY, 'Y' = 'Y',
                                                                              'N' = 'N',
                                                                            "Don't know" = 'DK', .ordered= T) ,
    
           ERGO_OPTIMIZAITON_BUDGET_REQUIRED = factor(ERGO_OPTIMIZAITON_BUDGET_REQUIRED),
           ERGO_OPTIMIZAITON_BUDGET_REQUIRED = recode_factor(ERGO_OPTIMIZAITON_BUDGET_REQUIRED, 'Y' = 'Y',
                                                                              'N' = 'N',
                                                                            "Don't know" = 'DK', .ordered= T),
                 
                                                
          EXPERIENCE_IMPROVED_DIAL_EXTENDERS = factor(EXPERIENCE_IMPROVED_DIAL_EXTENDERS),
           EXPERIENCE_IMPROVED_DIAL_EXTENDERS = recode_factor(EXPERIENCE_IMPROVED_DIAL_EXTENDERS, 'Y' = 'Y',
                                                                              'N' = 'N',
                                                                            "Don't know" = 'DK', .ordered= T),
     
           EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES = factor(EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES),
           EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES = recode_factor(EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES, 'Y' = 'Y',
                                                                              'N' = 'N',
                                                                            "Don't know" = 'DK', .ordered= T) ,
     
           EXPERIENCE_IMPROVED_APRONS = factor(EXPERIENCE_IMPROVED_APRONS),
           EXPERIENCE_IMPROVED_APRONS = recode_factor(EXPERIENCE_IMPROVED_APRONS, 'Y' = 'Y',
                                                                              'N' = 'N',
                                                                            "Don't know" = 'DK', .ordered= T),
     
           ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED = factor(ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED),
           ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED = recode_factor(ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED, 'Y' = 'Y',
                                                                              'N' = 'N',
                                                                            "Don't know" = 'DK', .ordered= T))  %>% 
  
  
   mutate( ERGONOMIC_IMPORTANCE = factor(ERGONOMIC_IMPORTANCE),
           ERGONOMIC_IMPORTANCE = recode_factor(ERGONOMIC_IMPORTANCE, 'Both A and C' = 'Correct',
                                                                       .default = 'Incorrect', .ordered= T) ,
    
           MITIGATING_MUSCLE_STRAIN = factor(MITIGATING_MUSCLE_STRAIN),
           MITIGATING_MUSCLE_STRAIN = recode_factor(MITIGATING_MUSCLE_STRAIN, 'All of the above' = 'Correct',
                                                                       .default = 'Incorrect', .ordered= T) ,
    
           BED_POSITION = factor(BED_POSITION),
           BED_POSITION = recode_factor(BED_POSITION, '10 cm below elbow height' = 'Correct',
                                                                       .default = 'Incorrect', .ordered= T) ,
    
           ENDO_TRAINER_POSITION = factor(ENDO_TRAINER_POSITION),
           ENDO_TRAINER_POSITION = recode_factor(ENDO_TRAINER_POSITION, 'At the foot of the bed, on the same side of the trainee.' = 'Correct',
                                                                       .default = 'Incorrect', .ordered= T) ,
    
           WHEN_DISABILITY_INSURANCE = factor(WHEN_DISABILITY_INSURANCE),
           WHEN_DISABILITY_INSURANCE = recode_factor(WHEN_DISABILITY_INSURANCE, 'During training' = 'Correct',
                                                                       .default = 'Incorrect', .ordered= T) ) 


Here’s a glimpse of the structure of the resulting dataset SURVEY:

glimpse(SURVEY)
## Rows: 200
## Columns: 88
## $ BIRTHSEX                                  <fct> F, F, F, M, F, F, F, F, F, M…
## $ RACE_SOUTHASIAN                           <chr> "N", "N", "N", "Y", "N", "N"…
## $ RACE_EASTASIAN                            <chr> "N", "N", "N", "N", "Y", "Y"…
## $ RACE_WHITE                                <chr> "N", "Y", "Y", "N", "N", "N"…
## $ RACE_BLACK                                <chr> "N", "N", "N", "N", "N", "N"…
## $ RACE_HISPANIC                             <chr> "Y", "N", "N", "N", "N", "N"…
## $ RACE_NATIVEAMER                           <chr> "N", "N", "N", "N", "N", "N"…
## $ RACE_PACIFICISLAND                        <chr> "N", "N", "N", "N", "N", "N"…
## $ RACE_OTHER                                <chr> "N", "N", "N", "N", "N", "N"…
## $ AGE                                       <chr> "30-34", "30-34", "30-34", "…
## $ TRAINING_LEVEL                            <ord> Third Year, Third Year, Firs…
## $ HEIGHT                                    <chr> "5'4-5'6", "5'4-5'6", "5'4-5…
## $ GLOVE                                     <dbl> 6.5, 6.5, 6.0, 7.0, 6.5, 5.5…
## $ GLOVE_SIZE_AVAILABLE                      <fct> Y, Y, Y, Y, N, N, Y, Y, N, Y…
## $ PERFORMANCE_HOURS                         <fct> 10-20, < 10, 10-20, 31-40, 1…
## $ TEACHER_GENDER_PREFERENCE                 <fct> No, No, Yes, No, No, No, No,…
## $ FEMALE_TRAINERS                           <fct> None, 6-10, 6-10, 6-10, 6-10…
## $ MALE_TRAINERS                             <fct> 6-10, > 10, > 10, > 10, > 10…
## $ EVER_INJURED                              <fct> N, N, N, N, Y, N, N, N, N, N…
## $ EXPERIENCED_TRANSIENT_PAIN_NO             <fct> Y, N, N, N, N, N, N, N, N, N…
## $ EXPERIENCED_TRANSIENT_PAIN_HAND           <fct> N, Y, Y, Y, Y, Y, Y, N, N, Y…
## $ EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER  <fct> N, Y, Y, Y, Y, N, Y, Y, Y, Y…
## $ EXPERIENCED_TRANSIENT_PAIN_BACK           <fct> N, Y, Y, Y, Y, N, Y, N, N, Y…
## $ EXPERIENCED_TRANSIENT_PAIN_LEG            <fct> N, N, Y, Y, N, N, N, N, N, N…
## $ EXPERIENCED_TRANSIENT_PAIN_FOOT           <fct> N, N, Y, Y, N, Y, N, N, N, N…
## $ GROWING_PAINS                             <fct> NA, Y, Y, Y, Y, N, N, Y, N, …
## $ FELLOWSHIP_FORMAL_ERGO_TRAINING           <fct> N, N, N, N, N, N, N, Y, N, Y…
## $ INFORMAL_TRAINING                         <fct> Y, Y, Y, Y, Y, Y, N, Y, Y, Y…
## $ TRAINING_TECHNIQUES_POSTURAL              <fct> Y, N, Y, Y, N, Y, Y, Y, N, Y…
## $ TRAINING_TECHNIQUES_BEDHEIGHT             <fct> Y, Y, Y, Y, Y, Y, Y, Y, Y, Y…
## $ TRAINING_TECHNIQUES_BEDANGLE              <fct> Y, N, Y, Y, N, Y, Y, N, Y, Y…
## $ TRAINING_TECHNIQUES_MONITORHEIGHT         <fct> Y, N, N, Y, N, Y, Y, N, Y, Y…
## $ TRAINING_TECHNIQUES_MUSCULOSKELETAL       <fct> Y, N, N, Y, N, N, N, Y, Y, N…
## $ TRAINING_TECHNIQUES_EXERCISE_STRETCHING   <fct> N, N, N, N, N, N, N, N, N, N…
## $ TRAINING_TECHNIQUES_DIAL_EXTENDERS        <fct> N, N, Y, N, Y, N, Y, N, N, N…
## $ TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE <fct> Y, N, Y, Y, Y, N, Y, Y, Y, N…
## $ ERGO_TRAINING_BUDGET                      <ord> DK, N, DK, DK, N, DK, DK, N,…
## $ ERGO_FEEDBACK                             <ord> Sometimes, Rarely, Sometimes…
## $ ERGO_FEEDBACK_BY_WHOM                     <ord> Mostly male teachers, Mostly…
## $ ERGO_OPTIMIZATION                         <ord> DK, N, N, Y, N, N, Y, DK, N,…
## $ DIAL_EXTENDERS_AVAILABLE                  <ord> DK, N, Y, Y, Y, N, Y, DK, N,…
## $ DIAL_EXTENDERS_ENCOURAGED                 <ord> DU, N, Y, Y, Y, DU, Y, NA, N…
## $ DIAL_EXTENDERS_FEMALEATT                  <ord> NA, NA, Not likely, NA, Very…
## $ DIAL_EXTENDERS_MALEATT                    <ord> NA, NA, Very likely, NA, Ver…
## $ PEDI_COLONOSCOPES_AVAILABLE               <ord> Y, Y, Y, Y, Y, Y, Y, Y, Y, Y…
## $ LEAD_APRONS_DONTKNOW                      <ord> Aware, Aware, Not Aware, Awa…
## $ LEAD_APRONS_LW_ONEPIECE                   <chr> "N", "N", "N", "Y", "N", "Y"…
## $ LEAD_APRONS_LW_TWOPIECE                   <chr> "Y", "N", "N", "Y", "N", "Y"…
## $ LEAD_APRONS_STANDARD_ONEPIECE             <chr> "N", "Y", "N", "Y", "N", "Y"…
## $ LEAD_APRONS_STANDARD_TWOPIECE             <chr> "N", "Y", "N", "Y", "N", "Y"…
## $ LEAD_APRONS_DOUBLE                        <chr> "N", "N", "N", "N", "N", "N"…
## $ LEAD_APRONS_THYROID                       <chr> "N", "N", "N", "Y", "N", "N"…
## $ LEAD_APRONS_MATERNALDOS                   <chr> "N", "N", "N", "N", "N", "N"…
## $ LEAD_APRONS_FETALDOS                      <chr> "N", "N", "N", "N", "N", "N"…
## $ ERGO_FORMAL_TIMEOUT_PRIOR                 <chr> "N", "N", "N", "N", "N", "N"…
## $ ERGO_INFORMAL_TIMEOUT_PRIOR               <chr> "Y", "N", "Y", "Y", "Y", "Y"…
## $ MONITORS_ADJUSTABLE                       <chr> "Y", "N", "N", "Y", "N", "Y"…
## $ TEACHER_SENSITIVITY_STATURE_HANDSIZE      <chr> "Y", "N", "N", "Y", "N", "N"…
## $ TEACHER_SENSITIVITY_BY_GENDER             <ord> Never had female teacher, No…
## $ TACTILE_INSTRUCTION_FROM_MALES            <ord> Often, No, No, No, No, No, O…
## $ TACTILE_INSTRUCTION_FROM_FEMALES          <ord> No, No, No, Rarely, Rarely, …
## $ COMFORTABLE_ASKING_NURSES                 <chr> "Y", "Y", "Y", "Y", "Y", "Y"…
## $ ASK_NURSES_ONCE                           <chr> "Y", "Y", "N", "N", "N", "Y"…
## $ ASK_NURSES_TWICE                          <chr> "N", "N", "Y", "N", "N", "N"…
## $ ASK_NURSES_MORE                           <chr> "N", "N", "N", "Y", "Y", "N"…
## $ COMFORTABLE_ASKING_TECHS                  <chr> "Y", "Y", "Y", "Y", "Y", "Y"…
## $ MALE_ATTENDINGS_ASKING                    <ord> Once, NA, More than twice, M…
## $ FEMALE_ATTENDINGS_ASKING                  <ord> Don't work with FemAtt, NA, …
## $ RECOGNIZED_RESPECTED_ES_STAFF             <chr> "Y", "Y", "Y", "Y", "Y", "Y"…
## $ RECOGNIZED_RESPECTED_ANESTHETISTS         <chr> "Y", "Y", "Y", "Y", "Y", "N"…
## $ RECOGNIZED_RESPECTED_GASTRO_ATTENDING     <chr> "Y", "Y", "Y", "Y", "Y", "Y"…
## $ FIRST_NAME_NO_PERMISSION                  <chr> "N", "Y", "Y", "N", "N", "Y"…
## $ ERGO_TRAINING_MANDATORY                   <ord> Y, Y, Y, Y, Y, Y, Y, Y, Y, Y…
## $ ERGO_OPTIMIZAITON_BUDGET_REQUIRED         <ord> Y, Y, Y, Y, Y, Y, Y, Y, Y, Y…
## $ EXPERIENCE_IMPROVED_DIAL_EXTENDERS        <ord> DK, DK, Y, N, Y, Y, Y, DK, Y…
## $ EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES     <ord> DK, N, Y, N, Y, Y, Y, N, Y, …
## $ EXPERIENCE_IMPROVED_APRONS                <ord> N, Y, Y, N, Y, Y, Y, DK, Y, …
## $ ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED    <ord> Y, Y, Y, Y, Y, Y, Y, Y, Y, Y…
## $ ERGONOMIC_IMPORTANCE                      <ord> Incorrect, Correct, Correct,…
## $ MITIGATING_MUSCLE_STRAIN                  <ord> Incorrect, Correct, Correct,…
## $ BED_POSITION                              <ord> Incorrect, Incorrect, Correc…
## $ ENDO_TRAINER_POSITION                     <ord> Incorrect, Correct, Incorrec…
## $ WHEN_DISABILITY_INSURANCE                 <ord> Incorrect, Correct, Correct,…
## $ AGE2                                      <fct> 30-34, 30-34, 30-34, 30-34, …
## $ RACE                                      <fct> HISPANIC, WHITE, WHITE, ASIA…
## $ RACE2                                     <fct> NON-WHITE, WHITE, WHITE, NON…
## $ HEIGHT2                                   <fct> 5'4-5'6, 5'4-5'6, 5'4-5'6, 6…
## $ NURSES_ASKING                             <ord> Once, Once, Twice, More than…


DEMOGRAPHIC DATA


Question 1: Distribution of RACE x AGE


#Chi-Square Test of Proportions

females_males = c(99, 101)
chisq.test(females_males, p= c(1/2, 1/2))
## 
##  Chi-squared test for given probabilities
## 
## data:  females_males
## X-squared = 0.02, df = 1, p-value = 0.8875
#SJPlot cross tabulation with Chi-Square/df
  
plot_xtab(SURVEY$AGE2, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Age Distribution by Birth Sex",
          axis.titles = c('Respondents Age Bands'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Age is desired 


CrossTable(SURVEY$AGE, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  200 
## 
##  
##              | SURVEY$BIRTHSEX 
##   SURVEY$AGE |         F |         M | Row Total | 
## -------------|-----------|-----------|-----------|
##         < 30 |         9 |         7 |        16 | 
##              |     0.091 |     0.069 |           | 
## -------------|-----------|-----------|-----------|
##        30-34 |        80 |        75 |       155 | 
##              |     0.808 |     0.743 |           | 
## -------------|-----------|-----------|-----------|
##        35-40 |        10 |        18 |        28 | 
##              |     0.101 |     0.178 |           | 
## -------------|-----------|-----------|-----------|
##        41-50 |         0 |         1 |         1 | 
##              |     0.000 |     0.010 |           | 
## -------------|-----------|-----------|-----------|
## Column Total |        99 |       101 |       200 | 
##              |     0.495 |     0.505 |           | 
## -------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  3.677372     d.f. =  3     p =  0.2984756 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.2661718 
## 
## 



Question 2: Distribution of RACE x BIRTHSEX


#SJPlot cross tabulation with Chi-Square/df
  
plot_xtab(SURVEY$RACE, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Race Distribution by Birth Sex",
          axis.titles = c('Race Categories '), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Race is desired 


CrossTable(SURVEY$RACE, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r = F, prop.t=F, chisq=T, fisher=F)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  200 
## 
##  
##              | SURVEY$BIRTHSEX 
##  SURVEY$RACE |         F |         M | Row Total | 
## -------------|-----------|-----------|-----------|
##   ASIAN EAST |        19 |        11 |        30 | 
##              |     0.192 |     0.109 |           | 
## -------------|-----------|-----------|-----------|
##  ASIAN SOUTH |        29 |        21 |        50 | 
##              |     0.293 |     0.208 |           | 
## -------------|-----------|-----------|-----------|
##        BLACK |         5 |         5 |        10 | 
##              |     0.051 |     0.050 |           | 
## -------------|-----------|-----------|-----------|
##     HISPANIC |         8 |         5 |        13 | 
##              |     0.081 |     0.050 |           | 
## -------------|-----------|-----------|-----------|
##        WHITE |        32 |        53 |        85 | 
##              |     0.323 |     0.525 |           | 
## -------------|-----------|-----------|-----------|
##        OTHER |         6 |         6 |        12 | 
##              |     0.061 |     0.059 |           | 
## -------------|-----------|-----------|-----------|
## Column Total |        99 |       101 |       200 | 
##              |     0.495 |     0.505 |           | 
## -------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  9.274804     d.f. =  5     p =  0.09859255 
## 
## 
## 



Question 3: Distribution of TRAINING LEVEL x BIRTHSEX


#SJPlot cross tabulation with Chi-Square/df
  
plot_xtab(SURVEY$TRAINING_LEVEL, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Training Levels by Birth Sex",
          axis.titles = c('Training Levels'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Training Level is desired 


CrossTable(SURVEY$TRAINING_LEVEL, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=F)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  199 
## 
##  
##                       | SURVEY$BIRTHSEX 
## SURVEY$TRAINING_LEVEL |         F |         M | Row Total | 
## ----------------------|-----------|-----------|-----------|
##            First Year |        40 |        32 |        72 | 
##                       |     0.404 |     0.320 |           | 
## ----------------------|-----------|-----------|-----------|
##           Second Year |        34 |        26 |        60 | 
##                       |     0.343 |     0.260 |           | 
## ----------------------|-----------|-----------|-----------|
##            Third Year |        20 |        36 |        56 | 
##                       |     0.202 |     0.360 |           | 
## ----------------------|-----------|-----------|-----------|
##               Avanced |         5 |         6 |        11 | 
##                       |     0.051 |     0.060 |           | 
## ----------------------|-----------|-----------|-----------|
##          Column Total |        99 |       100 |       199 | 
##                       |     0.497 |     0.503 |           | 
## ----------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  6.613035     d.f. =  3     p =  0.0853097 
## 
## 
## 



Question 4: Distribution of HEIGHT2 x BIRTHSEX


#SJPlot cross tabulation with Chi-Square/df
  
plot_xtab(SURVEY$HEIGHT2, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Height Bands by Birth Sex",
          axis.titles = c('Height Bands'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

SUBSET2 <-
SURVEY %>% 
  filter( !is.na(HEIGHT2)) %>% 
  mutate(BIRTHSEX = recode_factor( BIRTHSEX, "M" = "MALES", "F" = "FEMALES", .ordered=T))


ggplot(  SUBSET2, aes(x= HEIGHT2)) + facet_grid( SUBSET2$BIRTHSEX ) +  
  geom_bar(aes(fill= BIRTHSEX) ) +
  stat_count(geom="text", aes(label=..count..), vjust= -.3) + 
  scale_fill_manual( values = c( "MALES"="darkgrey", "FEMALES"="#006cc5"), guide = "none" )+
  theme_538()  +
  xlab("Height Bands")+ ylab("Counts") 

#Alternative View, if Birth Sex by Height is desired 



CrossTable(SURVEY$HEIGHT2, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r = F, prop.t=F, chisq=T, fisher=F)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  199 
## 
##  
##                | SURVEY$BIRTHSEX 
## SURVEY$HEIGHT2 |         F |         M | Row Total | 
## ---------------|-----------|-----------|-----------|
##           < 5' |         1 |         0 |         1 | 
##                |     0.010 |     0.000 |           | 
## ---------------|-----------|-----------|-----------|
##          5-5'3 |        33 |         2 |        35 | 
##                |     0.337 |     0.020 |           | 
## ---------------|-----------|-----------|-----------|
##        5'4-5'6 |        40 |         9 |        49 | 
##                |     0.408 |     0.089 |           | 
## ---------------|-----------|-----------|-----------|
##        5'7-5'9 |        23 |        34 |        57 | 
##                |     0.235 |     0.337 |           | 
## ---------------|-----------|-----------|-----------|
##        5'10-6' |         1 |        34 |        35 | 
##                |     0.010 |     0.337 |           | 
## ---------------|-----------|-----------|-----------|
##        6'1-6'4 |         0 |        21 |        21 | 
##                |     0.000 |     0.208 |           | 
## ---------------|-----------|-----------|-----------|
##          > 6'4 |         0 |         1 |         1 | 
##                |     0.000 |     0.010 |           | 
## ---------------|-----------|-----------|-----------|
##   Column Total |        98 |       101 |       199 | 
##                |     0.492 |     0.508 |           | 
## ---------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  103.2847     d.f. =  6     p =  5.173731e-20 
## 
## 
## 



Question 5: Distribution of GLOVE SIZE x BIRTHSEX


require(ggstatsplot)

#SJPlot cross tabulation with Chi-Square/df
  
plot_xtab(SURVEY$GLOVE, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Glove Size by Birth Sex",
          axis.titles = c('Glove Sizes'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Glove Size is desired 


CrossTable(SURVEY$GLOVE, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  195 
## 
##  
##              | SURVEY$BIRTHSEX 
## SURVEY$GLOVE |         F |         M | Row Total | 
## -------------|-----------|-----------|-----------|
##            5 |         1 |         0 |         1 | 
##              |     0.010 |     0.000 |           | 
## -------------|-----------|-----------|-----------|
##          5.5 |         7 |         0 |         7 | 
##              |     0.073 |     0.000 |           | 
## -------------|-----------|-----------|-----------|
##            6 |        24 |         0 |        24 | 
##              |     0.250 |     0.000 |           | 
## -------------|-----------|-----------|-----------|
##          6.5 |        48 |         6 |        54 | 
##              |     0.500 |     0.061 |           | 
## -------------|-----------|-----------|-----------|
##            7 |        14 |        31 |        45 | 
##              |     0.146 |     0.313 |           | 
## -------------|-----------|-----------|-----------|
##          7.5 |         2 |        49 |        51 | 
##              |     0.021 |     0.495 |           | 
## -------------|-----------|-----------|-----------|
##            8 |         0 |        10 |        10 | 
##              |     0.000 |     0.101 |           | 
## -------------|-----------|-----------|-----------|
##          8.5 |         0 |         3 |         3 | 
##              |     0.000 |     0.030 |           | 
## -------------|-----------|-----------|-----------|
## Column Total |        96 |        99 |       195 | 
##              |     0.492 |     0.508 |           | 
## -------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  127.3866     d.f. =  7     p =  2.208597e-24 
## 
## 
## 
#Median Glove Size - Sex Difference


  SURVEY %>% 
  group_by( BIRTHSEX) %>% 
  summarize( GLOVE_MEDIAN = median(GLOVE, na.rm=T))
## # A tibble: 2 × 2
##   BIRTHSEX GLOVE_MEDIAN
##   <fct>           <dbl>
## 1 F                 6.5
## 2 M                 7.5
ggbetweenstats( data= SURVEY,
                x = BIRTHSEX,
                y = GLOVE,
                type="nonparametric",
                p.adjust.method = "none")



Question 6: Distribution of AVG ENDOSCOPY HOURS x BIRTHSEX


#SJPlot cross tabulation with Chi-Square/df
  
plot_xtab(SURVEY$PERFORMANCE_HOURS, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Performance Hours by Birth Sex",
          axis.titles = c('Performance Hour Bands'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Performance Hours is desired 


CrossTable(SURVEY$PERFORMANCE_HOURS, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  199 
## 
##  
##                          | SURVEY$BIRTHSEX 
## SURVEY$PERFORMANCE_HOURS |         F |         M | Row Total | 
## -------------------------|-----------|-----------|-----------|
##                     < 10 |        22 |        26 |        48 | 
##                          |     0.224 |     0.257 |           | 
## -------------------------|-----------|-----------|-----------|
##                    10-20 |        48 |        45 |        93 | 
##                          |     0.490 |     0.446 |           | 
## -------------------------|-----------|-----------|-----------|
##                    21-30 |        19 |        23 |        42 | 
##                          |     0.194 |     0.228 |           | 
## -------------------------|-----------|-----------|-----------|
##                    31-40 |         7 |         5 |        12 | 
##                          |     0.071 |     0.050 |           | 
## -------------------------|-----------|-----------|-----------|
##                     > 40 |         2 |         2 |         4 | 
##                          |     0.020 |     0.020 |           | 
## -------------------------|-----------|-----------|-----------|
##             Column Total |        98 |       101 |       199 | 
##                          |     0.492 |     0.508 |           | 
## -------------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  1.099417     d.f. =  4     p =  0.8943647 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.9059433 
## 
## 



Question 7: Distribution of TEACHER SEX PEREFERENCE x BIRTHSEX


#SJPlot cross tabulation with Chi-Square/df
  
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TEACHER_GENDER_PREFERENCE,  margin = "row", 
          bar.pos = "stack", coord.flip = TRUE,
          title = "Teacher Sex Preference by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Teacher Sex Pref?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())



Question 8A & 8B: Distribution of NUMBER OF TEACHERS BY SEX x BIRTHSEX


#SJPlot cross tabulation with Chi-Square/df
  
plot_xtab(SURVEY$FEMALE_TRAINERS, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Number of Female Trainers by Birth Sex",
          axis.titles = c('Approx. Female Trainers'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Number of Female Trainers is desired 

CrossTable(SURVEY$FEMALE_TRAINERS, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  200 
## 
##  
##                        | SURVEY$BIRTHSEX 
## SURVEY$FEMALE_TRAINERS |         F |         M | Row Total | 
## -----------------------|-----------|-----------|-----------|
##                   None |         2 |         1 |         3 | 
##                        |     0.020 |     0.010 |           | 
## -----------------------|-----------|-----------|-----------|
##                    1-2 |         8 |         8 |        16 | 
##                        |     0.081 |     0.079 |           | 
## -----------------------|-----------|-----------|-----------|
##                    3-5 |        42 |        36 |        78 | 
##                        |     0.424 |     0.356 |           | 
## -----------------------|-----------|-----------|-----------|
##                   6-10 |        38 |        38 |        76 | 
##                        |     0.384 |     0.376 |           | 
## -----------------------|-----------|-----------|-----------|
##                   > 10 |         9 |        18 |        27 | 
##                        |     0.091 |     0.178 |           | 
## -----------------------|-----------|-----------|-----------|
##           Column Total |        99 |       101 |       200 | 
##                        |     0.495 |     0.505 |           | 
## -----------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  3.775249     d.f. =  4     p =  0.4372761 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.4349633 
## 
## 
plot_xtab(SURVEY$MALE_TRAINERS, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Number of Male Trainers by Birth Sex",
          axis.titles = c('Approx. Male Trainers'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Number of Male Trainers is desired 

CrossTable(SURVEY$MALE_TRAINERS, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  200 
## 
##  
##                      | SURVEY$BIRTHSEX 
## SURVEY$MALE_TRAINERS |         F |         M | Row Total | 
## ---------------------|-----------|-----------|-----------|
##                  1-2 |         0 |         2 |         2 | 
##                      |     0.000 |     0.020 |           | 
## ---------------------|-----------|-----------|-----------|
##                  3-5 |         6 |         9 |        15 | 
##                      |     0.061 |     0.089 |           | 
## ---------------------|-----------|-----------|-----------|
##                 6-10 |        47 |        47 |        94 | 
##                      |     0.475 |     0.465 |           | 
## ---------------------|-----------|-----------|-----------|
##                 > 10 |        46 |        43 |        89 | 
##                      |     0.465 |     0.426 |           | 
## ---------------------|-----------|-----------|-----------|
##         Column Total |        99 |       101 |       200 | 
##                      |     0.495 |     0.505 |           | 
## ---------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  2.681392     d.f. =  3     p =  0.4433988 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.5466762 
## 
## 



Question 10A-10E: Transient Pain Immediately Following Session - Specific Body Part


#SJPlot cross tabulation with Chi-Square/df
  
plot_xtab( SURVEY$BIRTHSEX, SURVEY$EXPERIENCED_TRANSIENT_PAIN_HAND, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Transient Pain in Hand after Procedure by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Hand Pain?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Transient Pain in Neck/Shoulder after Procedure by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Neck/Should Pain?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX,SURVEY$EXPERIENCED_TRANSIENT_PAIN_BACK,  margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Transient Pain in Back after Procedure by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Back Pain?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCED_TRANSIENT_PAIN_LEG, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Transient Pain in Leg after Procedure by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Leg Pain?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCED_TRANSIENT_PAIN_FOOT,  margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Transient Pain in Foot after Procedure by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Foot Pain?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())



Question 11: Told Injuries were “Growing Pains” x BIRTHSEX

(Exclude all respondents who did not report having been injured)


#SJPlot cross tabulation with Chi-Square/df
  

SUBSET <-  sqldf( "select BIRTHSEX,
                          GROWING_PAINS
                  from SURVEY
                  where GROWING_PAINS != 'NA' ")

SUBSET <- SUBSET %>% 
    mutate(GROWING_PAINS = recode_factor( GROWING_PAINS, "N" = "N",
                                                         "Y" = "Y")) %>% droplevels()

          

plot_xtab(SUBSET$BIRTHSEX, SUBSET$GROWING_PAINS, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Told Injuries were Growing Pains by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Growing Pains?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())



ENDOSCOPIC SUITE ENVIRONMENT

Question 1A & 1B: Distribution of FORMAL TRAINING & INFORMAL TRAINING by BIRTH SEX


plot_xtab(SURVEY$BIRTHSEX, SURVEY$FELLOWSHIP_FORMAL_ERGO_TRAINING, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Formal Ergo Training by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Formal Ergo Traiing?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab( SURVEY$BIRTHSEX, SURVEY$INFORMAL_TRAINING,margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Informal Ergo Training by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Informal Ergo Training?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())



Question 2A-2H: Distribution of TECHNIQUES DISCUSSED DURING TRAINING by BIRTH SEX


plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_POSTURAL, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Training on Postural Awareness by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Training Postural Awareness?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_BEDHEIGHT, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Training on Bed Height Adjustments by Birth Sex",
          axis.titles = "Birth Sex",  
          legend.title= "Training Bed Height?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_BEDANGLE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Training on Bed Angle Adjustments by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Training Bed Angle?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_MONITORHEIGHT, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Training on Monitor Height Adjustments by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Training Monitor Height?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_MUSCULOSKELETAL, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Training on Musculoskeletal Maneuvers by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Training Musculoskeletal?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_EXERCISE_STRETCHING, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Training on Exercise/Stretching by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Training Exer/Stretch?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab( SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_DIAL_EXTENDERS,margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Training on Dial Extenders by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Training Dial Ext?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Training on Pediatric Colonoscopes by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Traiing Pedi Coloscope?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())



Question 3: Distribution of BUDGET ALLOTMENT by BIRTH SEX


plot_xtab(SURVEY$ERGO_TRAINING_BUDGET, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Ergonomic Training Budget by Birth Sex",
          axis.titles = c('Ergonomic Training Budget?'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Ergo Training Budget is desired 


CrossTable(SURVEY$BIRTHSEX, SURVEY$ERGO_TRAINING_BUDGET, prop.chisq=F, prop.c=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Row Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  200 
## 
##  
##                 | SURVEY$ERGO_TRAINING_BUDGET 
## SURVEY$BIRTHSEX |         Y |         N |        DK | Row Total | 
## ----------------|-----------|-----------|-----------|-----------|
##               F |         2 |        24 |        73 |        99 | 
##                 |     0.020 |     0.242 |     0.737 |     0.495 | 
## ----------------|-----------|-----------|-----------|-----------|
##               M |         0 |        31 |        70 |       101 | 
##                 |     0.000 |     0.307 |     0.693 |     0.505 | 
## ----------------|-----------|-----------|-----------|-----------|
##    Column Total |         2 |        55 |       143 |       200 | 
## ----------------|-----------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  2.93414     d.f. =  2     p =  0.2306002 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.2478861 
## 
## 



Question 4A & 4B: Distribution of FEEBACK FREQUENCY & FEEDBACK BY WHOM by BIRTH SEX


plot_xtab(SURVEY$ERGO_FEEDBACK, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Ergo Feedback Frequency by Birth Sex",
          axis.titles = c('How Frequently Ergo Feedback?'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Ergo Feedback Frequency is desired 


CrossTable(SURVEY$ERGO_FEEDBACK, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  200 
## 
##  
##                      | SURVEY$BIRTHSEX 
## SURVEY$ERGO_FEEDBACK |         F |         M | Row Total | 
## ---------------------|-----------|-----------|-----------|
##                Never |         2 |         4 |         6 | 
##                      |     0.020 |     0.040 |           | 
## ---------------------|-----------|-----------|-----------|
##               Rarely |        29 |        39 |        68 | 
##                      |     0.293 |     0.386 |           | 
## ---------------------|-----------|-----------|-----------|
##            Sometimes |        55 |        49 |       104 | 
##                      |     0.556 |     0.485 |           | 
## ---------------------|-----------|-----------|-----------|
##                Often |        13 |         9 |        22 | 
##                      |     0.131 |     0.089 |           | 
## ---------------------|-----------|-----------|-----------|
##         Column Total |        99 |       101 |       200 | 
##                      |     0.495 |     0.505 |           | 
## ---------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  3.191001     d.f. =  3     p =  0.3631037 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.3735388 
## 
## 
plot_xtab(SURVEY$ERGO_FEEDBACK_BY_WHOM, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Who Provides Ergo Feedback by Birth Sex",
          axis.titles = c('Who Provides Feedback?'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Ergo Feedback by Whom is desired 


CrossTable(SURVEY$ERGO_FEEDBACK_BY_WHOM, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  200 
## 
##  
##                                 | SURVEY$BIRTHSEX 
##    SURVEY$ERGO_FEEDBACK_BY_WHOM |         F |         M | Row Total | 
## --------------------------------|-----------|-----------|-----------|
## Do not/rarely received feedback |        10 |        17 |        27 | 
##                                 |     0.101 |     0.168 |           | 
## --------------------------------|-----------|-----------|-----------|
##            Mostly male teachers |        16 |        19 |        35 | 
##                                 |     0.162 |     0.188 |           | 
## --------------------------------|-----------|-----------|-----------|
##          Mostly female teachers |        18 |        15 |        33 | 
##                                 |     0.182 |     0.149 |           | 
## --------------------------------|-----------|-----------|-----------|
##                    Both equally |        55 |        50 |       105 | 
##                                 |     0.556 |     0.495 |           | 
## --------------------------------|-----------|-----------|-----------|
##                    Column Total |        99 |       101 |       200 | 
##                                 |     0.495 |     0.505 |           | 
## --------------------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  2.563036     d.f. =  3     p =  0.4640066 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.4709419 
## 
## 



Question 5A - 5G: Distribution of EQUIPMENT OPITIMIZATOIN & AVAILABILITY by BIRTH SEX


plot_xtab( SURVEY$BIRTHSEX, SURVEY$ERGO_OPTIMIZATION, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Ergonomically Optimized Equipment by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Ergo Optimization?",
          geom.colors = c("#006cc5", "lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$GLOVE_SIZE_AVAILABLE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Glove Size Availability by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Glove Size Avail?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$DIAL_EXTENDERS_AVAILABLE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Dial Extender Availability by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Dial Ext Avail?",
          geom.colors = c("#006cc5","lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

SUBSET <-  sqldf( "select BIRTHSEX,
                          DIAL_EXTENDERS_ENCOURAGED
                  from SURVEY
                  where DIAL_EXTENDERS_ENCOURAGED != 'DU' ")

SUBSET <- SUBSET %>% 
    mutate(DIAL_EXTENDERS_ENCOURAGED = recode_factor( DIAL_EXTENDERS_ENCOURAGED, "N" = "N",
                                                         "Y" = "Y")) %>% droplevels()



plot_xtab(SUBSET$BIRTHSEX, SUBSET$DIAL_EXTENDERS_ENCOURAGED, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Dial Extenders Encouraged by Birth Sex - (Includes only subjects who use Dial Extenders)",
          axis.titles = "Birth Sex", 
          legend.title= "Dial Ext Encouraged?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

SUBSET <-  sqldf( "select BIRTHSEX,
                          DIAL_EXTENDERS_FEMALEATT
                  from SURVEY
                  where DIAL_EXTENDERS_FEMALEATT != 'NA' ")

SUBSET <- SUBSET %>% 
    mutate(DIAL_EXTENDERS_FEMALEATT = recode_factor( DIAL_EXTENDERS_FEMALEATT, "N" = "N",
                                                         "Y" = "Y")) %>% droplevels()



plot_xtab(SUBSET$BIRTHSEX, SUBSET$DIAL_EXTENDERS_FEMALEATT, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Dial Extenders Encouraged with Female Att by Birth Sex - (Includes only subjects who use Dial Extenders)",
          axis.titles = "Birth Sex", 
          legend.title= "Dial Ext FemAtt?",
          geom.colors = c("#006cc5","lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

SUBSET <-  sqldf( "select BIRTHSEX,
                          DIAL_EXTENDERS_MALEATT
                  from SURVEY
                  where DIAL_EXTENDERS_MALEATT != 'NA' ")

SUBSET <- SUBSET %>% 
    mutate(DIAL_EXTENDERS_MALEATT = recode_factor( DIAL_EXTENDERS_MALEATT, "N" = "N",
                                                         "Y" = "Y")) %>% droplevels()



plot_xtab(SUBSET$BIRTHSEX, SUBSET$DIAL_EXTENDERS_MALEATT, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Dial Extenders Encouraged with Male Att by Birth Sex - (Includes only subjects who use Dial Extenders)",
          axis.titles = "Birth Sex", 
          legend.title= "Dial Ext MaleAtt?",
          geom.colors = c("#006cc5","lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$PEDI_COLONOSCOPES_AVAILABLE, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Pediatric Colonoscopes by Birth Sex",
          axis.titles = c('Pedi Colonoscopes Available?'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Pedi Colonoscopes is desired 


CrossTable(SURVEY$PEDI_COLONOSCOPES_AVAILABLE, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  199 
## 
##  
##                                    | SURVEY$BIRTHSEX 
## SURVEY$PEDI_COLONOSCOPES_AVAILABLE |         F |         M | Row Total | 
## -----------------------------------|-----------|-----------|-----------|
##                                  Y |        93 |       100 |       193 | 
##                                    |     0.949 |     0.990 |           | 
## -----------------------------------|-----------|-----------|-----------|
##                                  N |         2 |         0 |         2 | 
##                                    |     0.020 |     0.000 |           | 
## -----------------------------------|-----------|-----------|-----------|
##                                 DK |         3 |         1 |         4 | 
##                                    |     0.031 |     0.010 |           | 
## -----------------------------------|-----------|-----------|-----------|
##                       Column Total |        98 |       101 |       199 | 
##                                    |     0.492 |     0.508 |           | 
## -----------------------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  3.209389     d.f. =  2     p =  0.2009509 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.178596 
## 
## 



Question 6A - 6I: Distribution of TYPE OF LEAD APRON AVAILABILITY by BIRTH SEX


plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_DONTKNOW, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Don't Know Whether Lead Aprons Available at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Aware of Lead Aprons?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab( SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_LW_ONEPIECE,margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Lead Aprons LW One-Piece Available at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Lead Aprons LW 1P?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_LW_TWOPIECE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Lead Aprons LW Two-Piece Available at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Lead Aprons LW 2P?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_STANDARD_ONEPIECE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Lead Aprons SW One-Piece Available at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Lead Aprons Std 1P?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_STANDARD_TWOPIECE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Lead Aprons SW Two-Piece Available at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Lead Aprons Std 2P?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_DOUBLE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Lead Aprons Double Lead (Maternity) Available at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Lead Aprons Double?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_THYROID, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Lead Aprons Thyroid Shield Available at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Lead Aprons Thyroid?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_MATERNALDOS, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Lead Aprons Maternal Dosimeter Available at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Lead Aprons Maternal?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_FETALDOS, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Lead Aprons Fetal Dosimeter Available at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Lead Aprons Fetal?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())



Question 7A - 7G: Distribution of ERGONOMIC CONSIDERATIONS by BIRTH SEX


plot_xtab(SURVEY$BIRTHSEX, SURVEY$ERGO_FORMAL_TIMEOUT_PRIOR, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Formal Ergo Timeouts at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Formal Ergo Timeout?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$ERGO_INFORMAL_TIMEOUT_PRIOR, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Informal Ergo Timeouts at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Informal Ergo Timeout?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab( SURVEY$BIRTHSEX, SURVEY$MONITORS_ADJUSTABLE,margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Monitors Easily Adjustable at Institution by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Monitors Easily Adjust?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$TEACHER_SENSITIVITY_STATURE_HANDSIZE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Teachers Train with Sensitivity to Stature/Hand Size by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Teacher Sensitivity to Stature?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$TEACHER_SENSITIVITY_BY_GENDER, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Sex of Sensitive Teachers by Birth Sex",
          axis.titles = c('Male or Female Teachers More Sensitive?'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Male or Female Teacher more Sensitive is desired 

CrossTable(SURVEY$TEACHER_SENSITIVITY_BY_GENDER, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  198 
## 
##  
##                                      | SURVEY$BIRTHSEX 
## SURVEY$TEACHER_SENSITIVITY_BY_GENDER |         F |         M | Row Total | 
## -------------------------------------|-----------|-----------|-----------|
##                                 Male |         6 |         7 |        13 | 
##                                      |     0.061 |     0.070 |           | 
## -------------------------------------|-----------|-----------|-----------|
##                               Female |        22 |         9 |        31 | 
##                                      |     0.224 |     0.090 |           | 
## -------------------------------------|-----------|-----------|-----------|
##                         Both Equally |        48 |        61 |       109 | 
##                                      |     0.490 |     0.610 |           | 
## -------------------------------------|-----------|-----------|-----------|
##             Never had female teacher |         3 |         1 |         4 | 
##                                      |     0.031 |     0.010 |           | 
## -------------------------------------|-----------|-----------|-----------|
##                             Not Sure |        19 |        22 |        41 | 
##                                      |     0.194 |     0.220 |           | 
## -------------------------------------|-----------|-----------|-----------|
##                         Column Total |        98 |       100 |       198 | 
##                                      |     0.495 |     0.505 |           | 
## -------------------------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  8.27915     d.f. =  4     p =  0.08187149 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.07371324 
## 
## 
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TACTILE_INSTRUCTION_FROM_MALES, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Tactile Instruction from Male Teachers by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Tactile Instruction from Males?",
          geom.colors = c("#006cc5","lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$TACTILE_INSTRUCTION_FROM_FEMALES, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Tactile Instruction from Females Teachers by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Tactile Instruction from Females?",
          geom.colors = c("#006cc5","lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())



Question 8A - 8I: Distribution of RESPECT-ORIENTED ANSWERS by BIRTH SEX


plot_xtab(SURVEY$BIRTHSEX, SURVEY$COMFORTABLE_ASKING_NURSES,  margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Comfortable Asking Nurses for Help by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Comfortable Asking Nurses?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

SUBSET <-  sqldf( "select BIRTHSEX,
                          COMFORTABLE_ASKING_TECHS
                  from SURVEY
                  where COMFORTABLE_ASKING_TECHS != 'NA' ")

SUBSET <- SUBSET %>% 
    mutate(COMFORTABLE_ASKING_TECHS = recode_factor( COMFORTABLE_ASKING_TECHS, "N" = "N",
                                                         "Y" = "Y")) %>% droplevels()



plot_xtab(SUBSET$BIRTHSEX, SUBSET$COMFORTABLE_ASKING_TECHS, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Comfortable Asking Techs for Help by Birth Sex (Includes only respondents with Techs)",
          axis.titles = "Birth Sex", 
          legend.title= "Comfortable Asking Techs?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab( SURVEY$BIRTHSEX, SURVEY$NURSES_ASKING, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Times Asking Nurses for Help by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Times Asking Nurses?",
          geom.colors = c("#006cc5", "lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$MALE_ATTENDINGS_ASKING, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Times Male Attending Asking Nurses for Help by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Times Asking MaleAtt?",
          geom.colors = c("#006cc5", "lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$FEMALE_ATTENDINGS_ASKING, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Times Female Attending Asking Nurses for Help by Birth Sex",
          axis.titles = c('Times Female Att Asking Nurses?'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Times Asking Female Attending is desired 

CrossTable(SURVEY$FEMALE_ATTENDINGS_ASKING, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  193 
## 
##  
##                                 | SURVEY$BIRTHSEX 
## SURVEY$FEMALE_ATTENDINGS_ASKING |         F |         M | Row Total | 
## --------------------------------|-----------|-----------|-----------|
##                            Once |        37 |        40 |        77 | 
##                                 |     0.394 |     0.404 |           | 
## --------------------------------|-----------|-----------|-----------|
##                           Twice |        23 |        27 |        50 | 
##                                 |     0.245 |     0.273 |           | 
## --------------------------------|-----------|-----------|-----------|
##                 More than Twice |        31 |        31 |        62 | 
##                                 |     0.330 |     0.313 |           | 
## --------------------------------|-----------|-----------|-----------|
##          Don't work with FemAtt |         3 |         1 |         4 | 
##                                 |     0.032 |     0.010 |           | 
## --------------------------------|-----------|-----------|-----------|
##                    Column Total |        94 |        99 |       193 | 
##                                 |     0.487 |     0.513 |           | 
## --------------------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  1.308227     d.f. =  3     p =  0.7271803 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.7653168 
## 
## 
plot_xtab(SURVEY$BIRTHSEX, SURVEY$RECOGNIZED_RESPECTED_ES_STAFF, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Recognized/Respected by ES Staff by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Recog by ES Staff?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$RECOGNIZED_RESPECTED_ANESTHETISTS, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Recognized/Respected by Anesthetists by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Recog by Anesthetists?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab( SURVEY$BIRTHSEX, SURVEY$RECOGNIZED_RESPECTED_GASTRO_ATTENDING,margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Recognized/Respected by Gastro Attending by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Recog by Gastro Att?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

plot_xtab(SURVEY$BIRTHSEX, SURVEY$FIRST_NAME_NO_PERMISSION,  margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "First Name Used No Permission by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "First Name No Permission?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Is there a RACE difference on this question ?


plot_xtab(SURVEY$RACE2, SURVEY$FIRST_NAME_NO_PERMISSION, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "First Name Used No Permission by Race (Broad)",
          axis.titles = "Binary Race Category", 
          legend.title= "First Name Used No Permission?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Is there a TRAINING LEVEL difference on this question ?


plot_xtab(SURVEY$TRAINING_LEVEL, SURVEY$FIRST_NAME_NO_PERMISSION, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "First Name Used No Permission by Training Level",
          axis.titles = "Binary Race Category", 
          legend.title= "First Name Used No Permission?",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())



FUTURE DESIRES FOR ENDOSCOPY SUITE

Question 1: Distribution of MANDAOTRY ERGO TRAINING by BIRTH SEX


plot_xtab(SURVEY$ERGO_TRAINING_MANDATORY, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Should Ergo Training be Mandaotry by Birth Sex",
          axis.titles = c('Mandatory Ergo Training?'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Ergo Training be Mandatory is desired 

CrossTable(SURVEY$ERGO_TRAINING_MANDATORY, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F , prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  198 
## 
##  
##                                | SURVEY$BIRTHSEX 
## SURVEY$ERGO_TRAINING_MANDATORY |         F |         M | Row Total | 
## -------------------------------|-----------|-----------|-----------|
##                              Y |        98 |        96 |       194 | 
##                                |     0.990 |     0.970 |           | 
## -------------------------------|-----------|-----------|-----------|
##                              N |         0 |         1 |         1 | 
##                                |     0.000 |     0.010 |           | 
## -------------------------------|-----------|-----------|-----------|
##                             DK |         1 |         2 |         3 | 
##                                |     0.010 |     0.020 |           | 
## -------------------------------|-----------|-----------|-----------|
##                   Column Total |        99 |        99 |       198 | 
##                                |     0.500 |     0.500 |           | 
## -------------------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  1.353952     d.f. =  2     p =  0.5081513 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.6211636 
## 
## 

Question 2: Distribution of ERGO BUDGET FOR OPTIMIZATION by BIRTH SEX


plot_xtab(SURVEY$ERGO_OPTIMIZAITON_BUDGET_REQUIRED, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Should Budget Include Ergo Optimiation by Birth Sex",
          axis.titles = c('Budget Should Include Ergo Opti?'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Ergo Optimization Budget be Mandatory is desired 

CrossTable(SURVEY$ERGO_OPTIMIZAITON_BUDGET_REQUIRED, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  198 
## 
##  
##                                          | SURVEY$BIRTHSEX 
## SURVEY$ERGO_OPTIMIZAITON_BUDGET_REQUIRED |         F |         M | Row Total | 
## -----------------------------------------|-----------|-----------|-----------|
##                                        Y |        95 |        89 |       184 | 
##                                          |     0.960 |     0.899 |           | 
## -----------------------------------------|-----------|-----------|-----------|
##                                        N |         0 |         3 |         3 | 
##                                          |     0.000 |     0.030 |           | 
## -----------------------------------------|-----------|-----------|-----------|
##                                       DK |         4 |         7 |        11 | 
##                                          |     0.040 |     0.071 |           | 
## -----------------------------------------|-----------|-----------|-----------|
##                             Column Total |        99 |        99 |       198 | 
##                                          |     0.500 |     0.500 |           | 
## -----------------------------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  4.013834     d.f. =  2     p =  0.1344024 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.1342971 
## 
## 

Question 3: Distribution of INCREASED AVAILABILITY OF DIAL EXTENDERS by BIRTH SEX


plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCE_IMPROVED_DIAL_EXTENDERS, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Increased Availability of Dial Extenders by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Increase Avail Dial Ext?",
          geom.colors = c("#006cc5","lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())


Question 4: Distribution of INCREASED AVAILABILITY OF PEDI COLONSCOPES by BIRTH SEX


plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Increased Availability of Pedi Colonoscopes by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Increase Avail Pediscopes?",
          geom.colors = c("#006cc5","lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())


Question 5: Distribution of INCREASED AVAILABILITY OF LEAD APRONS by BIRTH SEX


plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCE_IMPROVED_APRONS, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Increased Availability of Lead Aprons by Birth Sex",
          axis.titles = "Birth Sex", 
          legend.title= "Improve Aprons?",
          geom.colors = c("#006cc5","lightblue", "#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())


Question 6: Distribution of ERGO TRAINING REQUIRED FOR TEACHERS by BIRTH SEX


plot_xtab(SURVEY$ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED, SURVEY$BIRTHSEX, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Formal Ergo Training Required for Teachers by Birth Sex",
          axis.titles = c('Ergo Training Required for Teachers?'), 
          legend.title= "Birth Sex",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

#Alternative View, if Birth Sex by Formal Teacher Training Mandatory is desired 

CrossTable(SURVEY$ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T)  #rows then/over columns
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |           N / Col Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  198 
## 
##  
##                                               | SURVEY$BIRTHSEX 
## SURVEY$ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED |         F |         M | Row Total | 
## ----------------------------------------------|-----------|-----------|-----------|
##                                             Y |        90 |        91 |       181 | 
##                                               |     0.909 |     0.919 |           | 
## ----------------------------------------------|-----------|-----------|-----------|
##                                             N |         1 |         3 |         4 | 
##                                               |     0.010 |     0.030 |           | 
## ----------------------------------------------|-----------|-----------|-----------|
##                                            DK |         8 |         5 |        13 | 
##                                               |     0.081 |     0.051 |           | 
## ----------------------------------------------|-----------|-----------|-----------|
##                                  Column Total |        99 |        99 |       198 | 
##                                               |     0.500 |     0.500 |           | 
## ----------------------------------------------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  1.697833     d.f. =  2     p =  0.4278784 
## 
## 
##  
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p =  0.4998525 
## 
## 


ERGONOMIC KNOWLEDGE

Question 1: Importance of Ergonomics in Relation to ERI


plot_xtab(SURVEY$BIRTHSEX, SURVEY$ERGONOMIC_IMPORTANCE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Importance of Ergonomics in Relation to ERI",
          axis.titles = "Birth Sex", 
          legend.title= "Ergo Importance Response",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())


Question 2: Mitigation Stategies to Reduce Muscle Strain Risk


plot_xtab(SURVEY$BIRTHSEX, SURVEY$MITIGATING_MUSCLE_STRAIN, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Mitigation Strategies to Reduce Muscle Strain Risk",
          axis.titles = "Birth Sex", 
          legend.title= "Muscle Strain Response",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())


Question 3: Mitigation Stategies to Reduce Muscle Strain Risk


plot_xtab(SURVEY$BIRTHSEX, SURVEY$BED_POSITION, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Bed Position in Relation to the Elbow",
          axis.titles = "Birth Sex", 
          legend.title= "Bed Position Response",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())


Question 4: Best Position for Endoscopy Trainer


plot_xtab(SURVEY$BIRTHSEX, SURVEY$ENDO_TRAINER_POSITION, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Best Position for Endoscopy Trainer",
          axis.titles = "Birth Sex", 
          legend.title= "Trainer Position Response",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())


Question 5: Best Time to Explore Disability Insurance


plot_xtab(SURVEY$BIRTHSEX, SURVEY$WHEN_DISABILITY_INSURANCE, margin = "row", 
          bar.pos = "stack", coord.flip = TRUE, 
          title = "Best Time to Explore Disability Insurance",
          axis.titles = "Birth Sex", 
          legend.title= "When Disab Ins Response",
          geom.colors = c("#006cc5","#cbcccb"), 
          show.summary = TRUE )+ 
  set_theme(base= theme_classic())

CORRECT <-
  
  SURVEY %>% 
  mutate(CORRECT = across(.cols =  ERGONOMIC_IMPORTANCE: WHEN_DISABILITY_INSURANCE , .fns = str_count, "Correct")) %>%
          rowwise() %>%
          mutate(COUNT_CORRECT = across(.cols = contains("Correct"), .fns = sum)) %>% 
          select (BIRTHSEX, ERGONOMIC_IMPORTANCE: WHEN_DISABILITY_INSURANCE, COUNT_CORRECT) %>% 
          mutate( COUNT_CORRECT = as.integer(COUNT_CORRECT) )

eov.ttest(CORRECT, COUNT_CORRECT, BIRTHSEX)  
## [1] "F Test p.value = 0.7562784  EOV = TRUE (Pooled)"
## [1] "CORRECT : COUNT_CORRECT ~ BIRTHSEX"
## 
##  Two Sample t-test
## 
## data:  CORRECT : COUNT_CORRECT ~ BIRTHSEX
## t = 0.98604, df = 198, p-value = 0.3253
## alternative hypothesis: true difference in means between group F and group M is not equal to 0
## 95 percent confidence interval:
##  -0.1672054  0.5016388
## sample estimates:
## mean in group F mean in group M 
##        3.444444        3.277228
ggbetweenstats( data= CORRECT,
                x = BIRTHSEX,
                y = COUNT_CORRECT,
                type="parametric",
                p.adjust.method = "none",
                title = "Mean Scores by Birth Sex")



PLAYGROUND (FOR TESTING IDEAS)


Question 1: Is it useful to know a “Pain Score”?

PAIN_SCORE variable is created by turing six questions into numeric variables with binary values:
  • Sustained endoscopy-related injury (Yes = 1, No/NA = 0)
  • Tranisient pain experienced in hand (Yes = 1, No/NA = 0)
  • Transient pain experience in neck/shoulders (Yes = 1, No/NA = 0)
  • Transient pain experienced in back (Yes = 1, No/NA = 0)
  • Transient pain experienced in legs (Yes = 1, No/NA = 0)
  • Transient pain experienced in feet (Yes = 1, No/NA = 0)


PAIN <-

SURVEY %>% 
    mutate( BIRTHSEX2 = case_when( BIRTHSEX == "M" ~ 0,
                                      TRUE ~ 1 ),
      
            PAIN_INJ = case_when (EVER_INJURED == 'Y' ~ 1,
                                  TRUE ~ 0 ),
            
            PAIN_HAND = case_when (EXPERIENCED_TRANSIENT_PAIN_HAND == "Y" ~ 1,
                                   TRUE ~ 0),

            PAIN_NECK = case_when (EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER == "Y" ~ 1,
                                   TRUE ~ 0),

            PAIN_BACK = case_when (EXPERIENCED_TRANSIENT_PAIN_BACK == "Y" ~ 1,
                                   TRUE ~ 0),

            PAIN_LEG = case_when (EXPERIENCED_TRANSIENT_PAIN_LEG == "Y" ~ 1,
                                   TRUE ~ 0),

            PAIN_FOOT = case_when (EXPERIENCED_TRANSIENT_PAIN_FOOT == "Y" ~ 1,
                                   TRUE ~ 0)) %>% 
            rowwise() %>% 
            mutate(PAIN_SCORE = sum(PAIN_INJ+ PAIN_HAND+ PAIN_NECK+ PAIN_BACK + PAIN_LEG+ PAIN_FOOT)) %>% 
  
    select( BIRTHSEX, BIRTHSEX2, RACE, RACE2, TRAINING_LEVEL, EVER_INJURED, starts_with("PAIN_") )



# Test for normality of distribution (will be sensitive to outliers)
shapiro.test(PAIN$PAIN_SCORE)
## 
##  Shapiro-Wilk normality test
## 
## data:  PAIN$PAIN_SCORE
## W = 0.8912, p-value = 7.166e-11
# Group Means & Standard Deviations
PAIN %>% 
  group_by(BIRTHSEX) %>% 
  summarize( PAINMEAN = mean(PAIN_SCORE),
             PAINSD = sd(PAIN_SCORE))
## # A tibble: 2 × 3
##   BIRTHSEX PAINMEAN PAINSD
##   <fct>       <dbl>  <dbl>
## 1 F            2.24   1.39
## 2 M            1.76   1.31
# Welch's T-test

eov.ttest(PAIN, PAIN_SCORE, BIRTHSEX)
## [1] "F Test p.value = 0.5902336  EOV = TRUE (Pooled)"
## [1] "PAIN : PAIN_SCORE ~ BIRTHSEX"
## 
##  Two Sample t-test
## 
## data:  PAIN : PAIN_SCORE ~ BIRTHSEX
## t = 2.5156, df = 198, p-value = 0.01268
## alternative hypothesis: true difference in means between group F and group M is not equal to 0
## 95 percent confidence interval:
##  0.1037302 0.8563658
## sample estimates:
## mean in group F mean in group M 
##        2.242424        1.762376
# Violin Plot to explore differences between sexes
ggbetweenstats( data= PAIN,
                x = BIRTHSEX,
                y = PAIN_SCORE,
                type="parametric",
                p.adjust.method = "none",
                title = "Mean Pain/Injury Scores by Birth Sex")

corr.test(  PAIN$BIRTHSEX2,PAIN$PAIN_SCORE, method= 'pearson')
## Call:corr.test(x = PAIN$BIRTHSEX2, y = PAIN$PAIN_SCORE, method = "pearson")
## Correlation matrix 
## [1] 0.18
## Sample Size 
## [1] 200
## These are the unadjusted probability values.
##   The probability values  adjusted for multiple tests are in the p.adj object. 
## [1] 0.01
## 
##  To see confidence intervals of the correlations, print with the short=FALSE option